//逻辑层

//文件拖拽
function init() {
    //内文文件拖拽
    var neiwenkuang = document.getElementById("neiwenC");
    neiwenkuang.addEventListener("dragover", function (ev) {
        ev.stopPropagation();
        ev.preventDefault();
    }, false);
    neiwenkuang.addEventListener("dragend", function (ev) {
        ev.stopPropagation();
        ev.preventDefault();
    }, false);
    neiwenkuang.addEventListener("drop", function (ev) {
        ev.stopPropagation();
        ev.preventDefault();
        var file = ev.dataTransfer.files[0];
        var reader = new FileReader();
        var fileName = file.name;
        if (fileName.substr(-3, 3) == "fbd") {
            reader.readAsText(file, "gb2312");
            reader.onload = function (f) {
                neiwenTxt = this.result;
                neiwenTxt = neiwenTxt.replace(/&/g, "&amp;");
                neiwenTxt = neiwenTxt.replace(/</g, "&lt;");
                neiwenTxt = neiwenTxt.replace(/>/g, "&gt;");
                neiwenTxt = neiwenTxt.replace(/"/g, "&quot;");
                neiwenTxt = neiwenTxt.replace(/'/g, "&apos;");
                document.getElementById("neiwenC").innerHTML = neiwenTxt;
                document.getElementById("neiwenwenjianming-box").innerHTML = "";
                var spanObj = document.createElement('span');
                spanObj.innerHTML = fileName;
                spanObj.setAttribute("id", "neiwenwenjianming");
                document.getElementById("neiwenwenjianming-box").appendChild(spanObj);
                $(function () {
                    $("#pinheC").html("");
                    $("#pinhezifu").html(0);
                    $("#pinhebiaoti").html("拼合部分");
                    $("#pinhebiaoti").css("color", colorMoshi1);
                    $("#pinhebiaoti").css("color", colorMoshi1);
                    neiwenshuru();
                })
            }
        }
    }, false);

    //答案文件拖拽
    var daankuang = document.getElementById("daankuang");
    daankuang.addEventListener("dragover", function (ev) {
        ev.stopPropagation();
        ev.preventDefault();
    }, false);
    daankuang.addEventListener("dragend", function (ev) {
        ev.stopPropagation();
        ev.preventDefault();
    }, false);
    daankuang.addEventListener("drop", function (ev) {
        ev.stopPropagation();
        ev.preventDefault();
        var file = ev.dataTransfer.files[0];
        var reader = new FileReader();
        var fileName = file.name;
        if (fileName.substr(-3, 3) == "fbd") {
            reader.readAsText(file, "gb2312");
            reader.onload = function (f) {
                daanTxt = this.result;
                daanTxt = daanTxt.replace(/&/g, "&amp;");
                daanTxt = daanTxt.replace(/</g, "&lt;");
                daanTxt = daanTxt.replace(/>/g, "&gt;");
                daanTxt = daanTxt.replace(/"/g, "&quot;");
                daanTxt = daanTxt.replace(/'/g, "&apos;");
                document.getElementById("daanC").innerHTML = daanTxt;
                document.getElementById("daanwenjianming-box").innerHTML = "";
                var spanObj = document.createElement('span');
                spanObj.innerHTML = fileName;
                spanObj.setAttribute("id", "daanwenjianming");
                document.getElementById("daanwenjianming-box").appendChild(spanObj);
                $(function () {
                    $("#pinheC").html("");
                    $("#pinhezifu").html(0);
                    $("#pinhebiaoti").html("拼合部分");
                    $("#pinhebiaoti").css("color", colorMoshi4);
                    daanshuru();
                })
            }
        }
    }, false);
}
//设置页面属性，不执行默认处理（拒绝被拖放）
document.ondragover = function (e) { e.preventDefault(); };
document.ondrop = function (e) { e.preventDefault(); }
window.onload = init;

//主题设置
var colorMoshi1 = "royalblue";
var colorMoshi2 = "white";
var colorMoshi3 = "black";
var colorMoshi4 = "#c2c2c2";
var colorMoshi5 = "#c3e9c9"
var colorMoshi6 = "orange";
var colorMoshi7 = "#FF00FF";
var colorMoshi8 = "#cec7fa";
var colorMoshi10 = "red";

//数据设置
infoJson = [
    ["语文", "图书类", "金太阳新考案/新亮剑", "(?<=\\n|^)(.*?)((〖=A[（(]〗\\d+[.．]〖=〗)|([\\[〖]ZK[（（])|((〖STHZ〗)*〖HTH〗((例(\\d+?)*)|(【写作指导】))〖HTSS〗(〖STBZ〗)*))([\\s\\S]+?)(?=\\n\\n+|$)"],
    ["数学", "图书类", "金太阳新考案/新亮剑", "(?<=\\n|^).*?〖HTH〗解析〖HTK〗[\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["数学", "图书类", "仿真训练", "(〖=1[（()]〗\\d+[.．]〖=〗)|(〖=[ABC][(（]〗[\\s\\S]+?〖=〗)|((?<=〖FL[）)]〗)[\\s\\S]+?(?=〖FL[(（]))"],
    ["英语", "图书类", "金太阳新考案/新亮剑", "(?<=\\n|^).*?〖HTH〗解析〖HTK〗[\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["政治", "图书类", "金太阳新考案/新亮剑", "(?<=\\n|^).*?〖HTH〗解析〖HTK〗[\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["历史", "图书类", "金太阳新考案/新亮剑", "(?<=\\n|^).*?〖HTH〗解析〖HTK〗[\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["地理", "图书类", "金太阳新考案/新亮剑", "(((?<=\\n|^)(\\d+[.．])(〖ZK[(（]〗)*([A-Z]+)(〖ZK[）)]〗)*[]*(?=\\n\\n|$))|((?<=\\n|^)(\\d+[.．])(〖ZK[(（]〗)*(〖HTH〗【*)(答案)(】*〖HTSS〗)([\\s\\S]+?)(〖ZK[）)]〗)*[]*(?=\\n\\n|$))|((?<=\\n|^)(\\d+[.．])(〖ZK[(（]〗)*((.+?〓)+)(〖HTH〗【*)(解析)(】*〖HTSS〗)([\\s\\S]+?)(〖ZK[）)]〗)*[]*(?=\\n\\n|$))|((?<=\\n|^)(\\d+[.．])(〖ZK[(（]〗)*(〖HTH〗【*)(答案)(】*〖HTSS〗)([\\s\\S]+?)([])(\\n)(〖HTH〗【*)(解析)(】*〖HTSS〗)([\\s\\S]+?)(〖ZK[）)]〗)*[]*(?=\\n\\n|$)))"],
    ["地理", "图书类", "小题大做", "〖HTH〗【答案】〖HTK〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["物理", "图书类", "金太阳新考案/新亮剑", "(?<=\\n|^).*?〖HTH〗解析〖HTK〗[\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["化学", "图书类", "金太阳新考案/新亮剑", "(?<=\\n|^).*?〖HTH〗解析〖HTK〗[\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["生物", "图书类", "金太阳新考案/新亮剑", "(?<=\\n|^).*?〖HTH〗解析〖HTK〗[\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["生物", "图书类", "易得分", "(((\\d+[.．])〖ZK[（(].*?〗)|((?<=〖XC典例.+?〗).+?)|(1[.．][×√]〓))[\\s\\S]+?*(?=\\n\\n+|$)"],
    ["语文", "试卷类", "高三年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["语文", "试卷类", "基础年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["语文", "试卷类", "金典卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["数学", "试卷类", "高三年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["数学", "试卷类", "基础年级 · 卷行天下", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["数学", "试卷类", "基础年级 · 单元卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["数学", "试卷类", "金典卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["数学", "试卷类", "678密卷 · 限时速练", "〖=A[(（]〗\\d+[.．]〖=〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["英语", "试卷类", "高三年级试卷", "(?<=\\n|^).*?(〖JZ〗〖((HTH)|(WTHZ))〗.+?〖((HTSS)|(WTBZ))〗)[][\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["英语", "试卷类", "基础年级试卷", "(?<=\\n|^).*?(〖JZ〗〖((HTH)|(WTHZ))〗.+?〖((HTSS)|(WTBZ))〗)[][\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["英语", "试卷类", "金典卷", "(?<=\\n|^)((\\d~)|(\\d+[.．])|(\\d\\d~)|(短文改错)|(书面表达)|(第一节)|(第二节))[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["政治", "试卷类", "高三年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["政治", "试卷类", "基础年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["政治", "试卷类", "金典卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["政治", "试卷类", "678密卷 · 限时速练", "〖=A[(（]〗\\d+[.．]〖=〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["历史", "试卷类", "高三年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["历史", "试卷类", "基础年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["历史", "试卷类", "金典卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["历史", "试卷类", "678密卷 · 限时速练", "〖=A[(（]〗\\d+[.．]〖=〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["地理", "试卷类", "高三年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["地理", "试卷类", "基础年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["地理", "试卷类", "金典卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["地理", "试卷类", "678密卷 · 限时速练", "〖=A[(（]〗\\d+[.．]〖=〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["物理", "试卷类", "高三年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["物理", "试卷类", "基础年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["物理", "试卷类", "金典卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["物理", "试卷类", "678密卷 · 限时速练", "〖=A[(（]〗\\d+[.．]〖=〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["化学", "试卷类", "高三年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["化学", "试卷类", "基础年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["化学", "试卷类", "金典卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["生物", "试卷类", "高三年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["生物", "试卷类", "基础年级试卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["生物", "试卷类", "金典卷", "(?<=\\n|^).*?〖ZK[(（]〗[\\s\\S]+?(?=(\\n\\n+)|$)"],
    ["语文", "报纸类", "高三全国卷/核心突破卷", "(?<=\\n|^)\\d+[.．][\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["数学", "报纸类", "高三全国卷/核心突破卷", "(?<=\\n|^)\\d+[.．][\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["英语", "报纸类", "高三全国卷/核心突破卷", "(?<=\\n|^)((〖HT.*?H〗(第一部分〓听力|【素养导读】|【语篇理解】|第四部分〓写作\\n*第一节|第二节)〖HT.*?BS〗(?!([]*\\n*〖HTH〗【|\\n\\n+)))|(.*?〖ZK[(（]〗))([\\s\\S]+?)(?=(\\n\\n+)|$)"],
    ["政治", "报纸类", "高三全国卷/核心突破卷", "(?<=\\n|^)\\d+[.．][\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["历史", "报纸类", "高三全国卷/核心突破卷", "(?<=\\n|^)\\d+[.．][\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["地理", "报纸类", "高三全国卷/核心突破卷", "(?<=\\n|^)\\d+[.．][\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["物理", "报纸类", "高三全国卷/核心突破卷", "(?<=\\n|^)\\d+[.．][\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["化学", "报纸类", "高三全国卷/核心突破卷", "(?<=\\n|^)\\d+[.．][\\s\\S]*?(?=(\\n\\n+)|$)"],
    ["生物", "报纸类", "高三全国卷/核心突破卷", "(?<=\\n|^)\\d+[.．][\\s\\S]*?(?=(\\n\\n+)|$)"],
]

//启动事件
function start() {
    shuju();
    tihuanPanding();
    tiquPanding();
    tihuanquedingY();
    tiququedingY();
    neiwengeshikemupanding();
    daangeshikemupanding();
    pinheTijiaoPanding();
}

//数据加载
function shuju() {
    $("#leibie").html("");
    var kemu = ["语文", "数学", "英语", "政治", "历史", "地理", "物理", "化学", "生物"];
    for (i = 0; i < kemu.length; i++) {
        $("#leibie").append('\
            <option value="' + kemu[i] + '">' + kemu[i] + '</option>\
        ');
    }
    $("#chanpin1").html("");
    var leixing = ["图书类", "试卷类", "报纸类"];
    for (i = 0; i < leixing.length; i++) {
        $("#chanpin1").append('\
            <option value="' + leixing[i] + '">' + leixing[i] + '</option>\
        ');
    }
    $(".copyPinhe-box").hide();
}

//类别下拉
function leibiexiala() {
    cp2 = $("#chanpin2").val();
    chanpin2Panding();
    $("#chanpin2").val(cp2);
    tihuanPanding();
    tiquPanding();
    neiwengeshikemupanding();
    daangeshikemupanding();
    tihuanquedingN();
    tiququedingN();
    pinheTijiaoPanding();
    pinhefuwei();
}

//产品一类下拉
function chanpin1xiala() {
    cp2 = $("#chanpin2").val();
    chanpin2Panding();
    $("#chanpin2").val(cp2);
    tihuanPanding();
    tiquPanding();
    neiwengeshikemupanding();
    daangeshikemupanding();
    tihuanquedingN();
    tiququedingN();
    pinheTijiaoPanding();
    pinhefuwei();
}

//产品二类下拉
function chanpin2xiala() {
    tihuanPanding();
    tiquPanding();
    neiwengeshikemupanding();
    daangeshikemupanding();
    tihuanquedingN();
    tiququedingN();
    pinheTijiaoPanding();
    pinhefuwei();
    daanXialaZhengzePanding();
}

//产品二类判定
function chanpin2Panding() {
    $("#chanpin2").html("");
    for (i = 0; i < infoJson.length; i++) {
        if ($("#leibie").val() == infoJson[i][0] && $("#chanpin1").val() == infoJson[i][1]) {
            $("#chanpin2").append("<option value='" + infoJson[i][2] + "'>" + infoJson[i][2] + "</option>");
        }
    }
}

//替换判定
function tihuanPanding() {
    $("#tihuan").val("〖BP[（(]〗答案〖BP[）)]〗");
    $("#neiwen").val("答案");
}

//内文下拉
function neiwenxiala() {
    var neiwen = $("#neiwen").val();
    if (neiwen == "答案") {
        $("#tihuan").val("〖BP[（(]〗答案〖BP[）)]〗");
    }
    tihuanquedingN();
    pinheTijiaoPanding();
    pinhefuwei();
}

//替换输入
function tihuanshuru() {
    var neiwenC = $("#neiwenC").html();
    var tihuan = $("#tihuan").val();
    if (tihuan == "〖BP[（(]〗答案〖BP[）)]〗") {
        $("#neiwen").val("答案");
    } else {
        $("#neiwen").val("自定义");
    }
    if (neiwenC != "" && tihuan != "") {
        tihuanquedingN();
    } else {
        $("#tihuanqueding").removeClass("div-box-top-xianshi-queding").addClass("div-box-top-xianshi-queding-jinzhi");
    }
    pinheTijiaoPanding();
    pinhefuwei();
}

//替换按钮
function tihuanqueding() {
    if ($("#tihuanqueding").attr("class") == "div-box-top-xianshi-queding") {
        tihuanquedingY();
        pinheTijiaoPanding();
    }
}

//替换按钮开启
function tihuanquedingY() {
    if ($("#tihuanqueding").attr("class") == "div-box-top-xianshi-queding") {
        $("#tihuanqueding").removeClass("div-box-top-xianshi-queding").addClass("div-box-top-xianshi-queding-jinzhi");
    }
    var neiwenC = $("#neiwenC").html();
    if (neiwenC != "" && neiwenC != "<br>") {
        var tihuan = $("#tihuan").val();
        if (tihuan != "") {
            var neiwenCount = neiwenC.match(new RegExp(tihuan, 'g'));
        } else {
            var neiwenCount = null;
        }
        if (neiwenCount != null) {
            $("#neiwenbiaoti").html("内文部分 " + neiwenCount.length);
        } else {
            $("#neiwenbiaoti").html("内文部分 0");
        }
    } else {
        $("#neiwenbiaoti").html("内文部分");
    }
}

//替换按钮关闭
function tihuanquedingN() {
    var neiwenC = $("#neiwenC").html();
    var tihuan = $("#tihuan").val();
    if ($("#tihuanqueding").attr("class") == "div-box-top-xianshi-queding-jinzhi" && neiwenC != "" && tihuan != "") {
        $("#tihuanqueding").removeClass("div-box-top-xianshi-queding-jinzhi").addClass("div-box-top-xianshi-queding");
    }
    $("#neiwenbiaoti").html("内文部分");
    neiwengaoliangN();
}

//内文格式
function neiwensz() {
    if ($("#neiwensz").attr("class") == "div-box-top-xianshi-fuxuan") {
        $("#neiwensz").removeClass("div-box-top-xianshi-fuxuan").addClass("div-box-top-xianshi-fuxuan-xuanze");
        $("#daansz").removeClass("div-box-top-xianshi-fuxuan-xuanze").addClass("div-box-top-xianshi-fuxuan");
        $("#neiwengeshishezhi").fadeIn("slow");
        $(".div-box-center-in").scrollLeft(3000);
        $("#daangeshishezhi").hide();
    } else if ($("#neiwensz").attr("class") == "div-box-top-xianshi-fuxuan-xuanze") {
        $("#neiwensz").removeClass("div-box-top-xianshi-fuxuan-xuanze").addClass("div-box-top-xianshi-fuxuan");
        $(".div-box-center-in").scrollLeft(0);
    }
}

//内文格式科目判定
function neiwengeshikemupanding() {
    var leibie = $("#leibie").val();
    var chanpin1 = $("#chanpin1").val();
    var chanpin2 = $("#chanpin2").val();
    var info = leibie + chanpin1 + chanpin2;
    switch (info) {
        case "语文图书类金太阳新考案/新亮剑":
            neiwengeshishuju(NWGSywTslXkaxlj);
            break;
        case "数学图书类金太阳新考案/新亮剑":
            neiwengeshishuju(NWGSsxTslXkaxlj);
            break;
        case "英语图书类金太阳新考案/新亮剑":
            neiwengeshishuju(NWGSyyTslXkaxlj);
            break;
        case "政治图书类金太阳新考案/新亮剑":
            neiwengeshishuju(NWGSzzTslXkaxlj);
            break;
        case "历史图书类金太阳新考案/新亮剑":
            neiwengeshishuju(NWGSlsTslXkaxlj);
            break;
        case "地理图书类金太阳新考案/新亮剑":
            neiwengeshishuju(NWGSdlTslXkaxlj);
            break;
        case "物理图书类金太阳新考案/新亮剑":
            neiwengeshishuju(NWGSwlTslXkaxlj);
            break;
        case "化学图书类金太阳新考案/新亮剑":
            neiwengeshishuju(NWGShxTslXkaxlj);
            break;
        case "生物图书类金太阳新考案/新亮剑":
            neiwengeshishuju(NWGSswTslXkaxlj);
            break;
        case "生物图书类易得分":
            neiwengeshishuju(NWGSswTslYdf);
            break;
        case "语文试卷类基础年级试卷":
            neiwengeshishuju(NWGSywSjlJcnjsj);
            break;
        case "语文试卷类高三年级试卷":
            neiwengeshishuju(NWGSywSjlGsnjsj);
            break;
        case "数学试卷类基础年级 · 卷行天下":
            neiwengeshishuju(NWGSsxSjlJcnjjxtx);
            break;
        case "数学试卷类基础年级 · 单元卷":
            neiwengeshishuju(NWGSsxSjlJcnjdyj);
            break;
        case "数学试卷类高三年级试卷":
            neiwengeshishuju(NWGSsxSjlGsnjsj);
            break;
        case "数学试卷类金典卷":
            neiwengeshishuju(NWGSsxSjlJdj);
            break;
        case "英语试卷类基础年级试卷":
            neiwengeshishuju(NWGSyySjlJcnjsj);
            break;
        case "英语试卷类高三年级试卷":
            neiwengeshishuju(NWGSyySjlGsnjsj);
            break;
        case "英语试卷类金典卷":
            neiwengeshishuju(NWGSyySjlJdj);
            break;
        case "政治试卷类基础年级试卷":
            neiwengeshishuju(NWGSzzSjlJcnjsj);
            break;
        case "政治试卷类高三年级试卷":
            neiwengeshishuju(NWGSzzSjlGsnjsj);
            break;
        case "政治试卷类金典卷":
            neiwengeshishuju(NWGSzzSjlJdj);
            break;
        case "历史试卷类基础年级试卷":
            neiwengeshishuju(NWGSlsSjlJcnjsj);
            break;
        case "历史试卷类高三年级试卷":
            neiwengeshishuju(NWGSlsSjlGsnjsj);
            break;
        case "历史试卷类金典卷":
            neiwengeshishuju(NWGSlsSjlJdj);
            break;
        case "地理试卷类基础年级试卷":
            neiwengeshishuju(NWGSdlSjlJcnjsj);
            break;
        case "地理试卷类高三年级试卷":
            neiwengeshishuju(NWGSdlSjlGsnjsj);
            break;
        case "地理试卷类金典卷":
            neiwengeshishuju(NWGSdlSjlJdj);
            break;
        case "物理试卷类基础年级试卷":
            neiwengeshishuju(NWGSwlSjlJcnjsj);
            break;
        case "物理试卷类高三年级试卷":
            neiwengeshishuju(NWGSwlSjlGsnjsj);
            break;
        case "物理试卷类金典卷":
            neiwengeshishuju(NWGSwlSjlJdj);
            break;
        case "化学试卷类基础年级试卷":
            neiwengeshishuju(NWGShxSjlJcnjsj);
            break;
        case "化学试卷类高三年级试卷":
            neiwengeshishuju(NWGShxSjlGsnjsj);
            break;
        case "化学试卷类金典卷":
            neiwengeshishuju(NWGShxSjlJdj);
            break;
        case "生物试卷类基础年级试卷":
            neiwengeshishuju(NWGSswSjlJcnjsj);
            break;
        case "生物试卷类高三年级试卷":
            neiwengeshishuju(NWGSswSjlGsnjsj);
            break;
        case "生物试卷类金典卷":
            neiwengeshishuju(NWGSswSjlJdj);
            break;
        case "语文报纸类高三全国卷/核心突破卷":
            neiwengeshishuju(NWGSywBzlGsqgjhxtpj);
            break;
        case "数学报纸类高三全国卷/核心突破卷":
            neiwengeshishuju(NWGSsxBzlGsqgjhxtpj);
            break;
        case "英语报纸类高三全国卷/核心突破卷":
            neiwengeshishuju(NWGSyyBzlGsqgjhxtpj);
            break;
        case "政治报纸类高三全国卷/核心突破卷":
            neiwengeshishuju(NWGSzzBzlGsqgjhxtpj);
            break;
        case "历史报纸类高三全国卷/核心突破卷":
            neiwengeshishuju(NWGSlsBzlGsqgjhxtpj);
            break;
        case "地理报纸类高三全国卷/核心突破卷":
            neiwengeshishuju(NWGSdlBzlGsqgjhxtpj);
            break;
        case "物理报纸类高三全国卷/核心突破卷":
            neiwengeshishuju(NWGSwlBzlGsqgjhxtpj);
            break;
        case "化学报纸类高三全国卷/核心突破卷":
            neiwengeshishuju(NWGShxBzlGsqgjhxtpj);
            break;
        case "生物报纸类高三全国卷/核心突破卷":
            neiwengeshishuju(NWGSswBzlGsqgjhxtpj);
            break;
        default:
            neiwengeshishuju(NWGSnullSj);
    }
}

//内文格式数据加载
function neiwengeshishuju(sjlx) {
    var num = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10"];
    $("#neiwengeshiliebiao").html("");
    for (i = 0; i < 10; i++) {
        if (sjlx[i].tx != "") {
            $("#neiwengeshiliebiao").append('\
                <div class="neiwen-zhengzechuli-box">\
                    <span class="div-box-top-shezhi-tiaomu-div-sp">' + num[i] + '查找&nbsp;&nbsp;</span>\
                    <div id="neiwencz' + (i + 1) + '" class="div-box-grep-shezhi-shuru" contenteditable="true">' + sjlx[i].cz + '</div>\
                    <span class="div-box-top-shezhi-tiaomu-div-sp">' + num[i] + '替换&nbsp;&nbsp;</span>\
                    <div id="neiwenth' + (i + 1) + '" class="div-box-grep-shezhi-shuru" contenteditable="true">' + sjlx[i].th + '</div>\
                </div>\
                <div class="neiwen-zhengzechuli-box">\
                    <span class="div-box-top-shezhi-tiaomu-div-sp">' + num[i] + '题型&nbsp;&nbsp;</span>\
                    <div id="neiwenxgq' + (i + 1) + '" class="div-box-grep-shezhi-zhanshi">' + sjlx[i].tx + '</div>\
                    <span class="div-box-top-shezhi-tiaomu-div-sp">' + num[i] + '格式&nbsp;&nbsp;</span>\
                    <div id="neiwenxgh' + (i + 1) + '" class="div-box-grep-shezhi-zhanshi">' + sjlx[i].gs + '</div>\
                </div>\
            ');
        } else {
            $("#neiwengeshiliebiao").append('\
                <div class="neiwen-zhengzechuli-box">\
                    <span class="div-box-top-shezhi-tiaomu-div-sp">' + num[i] + '查找&nbsp;&nbsp;</span>\
                    <div id="neiwencz' + (i + 1) + '" class="div-box-grep-shezhi-shuru" contenteditable="true">' + sjlx[i].cz + '</div>\
                    <span class="div-box-top-shezhi-tiaomu-div-sp">' + num[i] + '替换&nbsp;&nbsp;</span>\
                    <div id="neiwenth' + (i + 1) + '" class="div-box-grep-shezhi-shuru" contenteditable="true">' + sjlx[i].th + '</div>\
                </div>\
            ');
        }
    }
}

//提取判定
function tiquPanding() {
    for (i = 0; i < infoJson.length; i++) {
        if ($("#leibie").val() == infoJson[i][0] && $("#chanpin1").val() == infoJson[i][1] && $("#chanpin2").val() == infoJson[i][2]) {
            $("#tiqu").val(infoJson[i][3]);
            return;
        }
    }
}

//答案下拉
function daanxiala() {
    daanXialaZhengzePanding();
    tiququedingN();
    pinheTijiaoPanding();
    pinhefuwei();
}

//答案下拉正则判定
function daanXialaZhengzePanding() {
    if ($("#daan").val() == "答案") {
        tiquPanding();
    }
}

//提取输入
function tiqushuru() {
    var daanC = $("#daanC").html();
    var tiqu = $("#tiqu").val();
    tiqushuruZhengzePanding();
    if (daanC != "" && tiqu != "") {
        tiququedingN();
    } else {
        $("#tiququeding").removeClass("div-box-top-xianshi-queding").addClass("div-box-top-xianshi-queding-jinzhi");
    }
    pinheTijiaoPanding();
    pinhefuwei();
}

//提取输入正则判定
function tiqushuruZhengzePanding() {
    $("#daan").val("自定义");
    for (i = 0; i < infoJson.length; i++) {
        if ($("#leibie").val() == infoJson[i][0] && $("#chanpin1").val() == infoJson[i][1] && $("#chanpin2").val() == infoJson[i][2] && $("#tiqu").val() == infoJson[i][3]) {
            $("#daan").val("答案");
            return;
        }
    }
}

//提取按钮
function tiququeding() {
    if ($("#tiququeding").attr("class") == "div-box-top-xianshi-queding") {
        tiququedingY();
        pinheTijiaoPanding();
    }
}

//提取按钮开启
function tiququedingY() {
    if ($("#tiququeding").attr("class") == "div-box-top-xianshi-queding") {
        $("#tiququeding").removeClass("div-box-top-xianshi-queding").addClass("div-box-top-xianshi-queding-jinzhi");
    }
    var daanC = $("#daanC").html();
    if (daanC != "" && daanC != "<br>") {
        var tiqu = $("#tiqu").val();
        if (tiqu != "") {
            var daanCount = daanC.match(new RegExp(tiqu, 'g'));
        } else {
            var daanCount = null;
        }
        if (daanCount != null) {
            $("#daanbiaoti").html("答案部分 " + daanCount.length);
        } else {
            $("#daanbiaoti").html("答案部分 0");
        }
    } else {
        $("#daanbiaoti").html("答案部分");
    }
}

//提取按钮关闭
function tiququedingN() {
    var daanC = $("#daanC").html();
    var tiqu = $("#tiqu").val();
    if ($("#tiququeding").attr("class") == "div-box-top-xianshi-queding-jinzhi" && daanC != "" && tiqu != "") {
        $("#tiququeding").removeClass("div-box-top-xianshi-queding-jinzhi").addClass("div-box-top-xianshi-queding");
    }
    $("#daanbiaoti").html("答案部分");
    daangaoliangN();
}

//答案格式
function daansz() {
    if ($("#daansz").attr("class") == "div-box-top-xianshi-fuxuan") {
        $("#daansz").removeClass("div-box-top-xianshi-fuxuan").addClass("div-box-top-xianshi-fuxuan-xuanze");
        $("#neiwensz").removeClass("div-box-top-xianshi-fuxuan-xuanze").addClass("div-box-top-xianshi-fuxuan");
        $("#daangeshishezhi").fadeIn("slow");
        $(".div-box-center-in").scrollLeft(3000);
        $("#neiwengeshishezhi").hide();
    } else if ($("#daansz").attr("class") == "div-box-top-xianshi-fuxuan-xuanze") {
        $("#daansz").removeClass("div-box-top-xianshi-fuxuan-xuanze").addClass("div-box-top-xianshi-fuxuan");
        $(".div-box-center-in").scrollLeft(0);
    }
}

//答案格式科目判定
function daangeshikemupanding() {
    var leibie = $("#leibie").val();
    var chanpin1 = $("#chanpin1").val();
    var chanpin2 = $("#chanpin2").val();
    var info = leibie + chanpin1 + chanpin2;
    switch (info) {
        case "语文图书类金太阳新考案/新亮剑":
            daangeshishuju(DAGSywTslXkaxlj);
            break;
        case "数学图书类金太阳新考案/新亮剑":
            daangeshishuju(DAGSswTslXkaxlj);
            break;
        case "英语图书类金太阳新考案/新亮剑":
            daangeshishuju(DAGSyyTslXkaxlj);
            break;
        case "政治图书类金太阳新考案/新亮剑":
            daangeshishuju(DAGSzzTslXkaxlj);
            break;
        case "历史图书类金太阳新考案/新亮剑":
            daangeshishuju(DAGSlsTslXkaxlj);
            break;
        case "地理图书类金太阳新考案/新亮剑":
            daangeshishuju(DAGSdlTslXkaxlj);
            break;
        case "物理图书类金太阳新考案/新亮剑":
            daangeshishuju(DAGSwlTslXkaxlj);
            break;
        case "化学图书类金太阳新考案/新亮剑":
            daangeshishuju(DAGShxTslXkaxlj);
            break;
        case "生物图书类金太阳新考案/新亮剑":
            daangeshishuju(DAGSswTslXkaxlj);
            break;
        case "生物图书类易得分":
            daangeshishuju(DAGSswTslYdf);
            break;
        case "语文试卷类基础年级试卷":
            daangeshishuju(DAGSywSjlJcnjsj);
            break;
        case "语文试卷类高三年级试卷":
            daangeshishuju(DAGSywSjlGsnjsj);
            break;
        case "语文试卷类金典卷":
            daangeshishuju(DAGSywSjlJdj);
            break;
        case "数学试卷类基础年级 · 卷行天下":
            daangeshishuju(DAGSsxSjlJcnjjxtx);
            break;
        case "数学试卷类基础年级 · 单元卷":
            daangeshishuju(DAGSsxSjlJcnjdyj);
            break;
        case "数学试卷类高三年级试卷":
            daangeshishuju(DAGSsxSjlGsnjsj);
            break;
        case "数学试卷类金典卷":
            daangeshishuju(DAGSsxSjlJdj);
            break;
        case "数学试卷类678密卷 · 限时速练":
            daangeshishuju(DAGSsxSjl678MjXssl);
            break;
        case "英语试卷类基础年级试卷":
            daangeshishuju(DAGSyySjlJcnjsj);
            break;
        case "英语试卷类高三年级试卷":
            daangeshishuju(DAGSyySjlGsnjsj);
            break;
        case "英语试卷类金典卷":
            daangeshishuju(DAGSyySjlJdj);
            break;
        case "政治试卷类基础年级试卷":
            daangeshishuju(DAGSzzSjlJcnjsj);
            break;
        case "政治试卷类高三年级试卷":
            daangeshishuju(DAGSzzSjlGsnjsj);
            break;
        case "政治试卷类金典卷":
            daangeshishuju(DAGSzzSjlJdj);
            break;
        case "政治试卷类678密卷 · 限时速练":
            daangeshishuju(DAGSzzSjl678MjXssl);
            break;
        case "历史试卷类基础年级试卷":
            daangeshishuju(DAGSlsSjlJcnjsj);
            break;
        case "历史试卷类高三年级试卷":
            daangeshishuju(DAGSlsSjlGsnjsj);
            break;
        case "历史试卷类金典卷":
            daangeshishuju(DAGSlsSjlJdj);
            break;
        case "历史试卷类678密卷 · 限时速练":
            daangeshishuju(DAGSlsSjl678MjXssl);
            break;
        case "地理试卷类基础年级试卷":
            daangeshishuju(DAGSdlSjlJcnjsj);
            break;
        case "地理试卷类高三年级试卷":
            daangeshishuju(DAGSdlSjlGsnjsj);
            break;
        case "地理试卷类金典卷":
            daangeshishuju(DAGSdlSjlJdj);
            break;
        case "地理试卷类678密卷 · 限时速练":
            daangeshishuju(DAGSdlSjl678MjXssl);
            break;
        case "物理试卷类基础年级试卷":
            daangeshishuju(DAGSwlSjlJcnjsj);
            break;
        case "物理试卷类高三年级试卷":
            daangeshishuju(DAGSwlSjlGsnjsj);
            break;
        case "物理试卷类金典卷":
            daangeshishuju(DAGSwlSjlJdj);
            break;
        case "物理试卷类678密卷 · 限时速练":
            daangeshishuju(DAGSwlSjl678MjXssl);
            break;
        case "化学试卷类基础年级试卷":
            daangeshishuju(DAGShxSjlJcnjsj);
            break;
        case "化学试卷类高三年级试卷":
            daangeshishuju(DAGShxSjlGsnjsj);
            break;
        case "化学试卷类金典卷":
            daangeshishuju(DAGShxSjlJdj);
            break;
        case "生物试卷类基础年级试卷":
            daangeshishuju(DAGSswSjlJcnjsj);
            break;
        case "生物试卷类高三年级试卷":
            daangeshishuju(DAGSswSjlGsnjsj);
            break;
        case "生物试卷类金典卷":
            daangeshishuju(DAGSswSjlJdj);
            break;
        case "语文报纸类高三全国卷/核心突破卷":
            daangeshishuju(DAGSywBzlGsqgjhxtpj);
            break;
        case "数学报纸类高三全国卷/核心突破卷":
            daangeshishuju(DAGSsxBzlGsqgjhxtpj);
            break;
        case "英语报纸类高三全国卷/核心突破卷":
            daangeshishuju(DAGSyyBzlGsqgjhxtpj);
            break;
        case "政治报纸类高三全国卷/核心突破卷":
            daangeshishuju(DAGSzzBzlGsqgjhxtpj);
            break;
        case "历史报纸类高三全国卷/核心突破卷":
            daangeshishuju(DAGSlsBzlGsqgjhxtpj);
            break;
        case "地理报纸类高三全国卷/核心突破卷":
            daangeshishuju(DAGSdlBzlGsqgjhxtpj);
            break;
        case "物理报纸类高三全国卷/核心突破卷":
            daangeshishuju(DAGSwlBzlGsqgjhxtpj);
            break;
        case "化学报纸类高三全国卷/核心突破卷":
            daangeshishuju(DAGShxBzlGsqgjhxtpj);
            break;
        case "生物报纸类高三全国卷/核心突破卷":
            daangeshishuju(DAGSswBzlGsqgjhxtpj);
            break;
        default:
            daangeshishuju(DAGSnull);
    }
}

//答案格式数据加载
function daangeshishuju(sjlx) {
    var num = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10"];
    $("#daangeshiliebiao").html("");
    for (i = 0; i < 10; i++) {
        if (sjlx[i].tx != "") {
            $("#daangeshiliebiao").append('\
                <div class="daan-zhengzechuli-box">\
                    <span class="div-box-top-shezhi-tiaomu-div-sp">' + num[i] + '查找&nbsp;&nbsp;</span>\
                    <div id="daancz' + (i + 1) + '" class="div-box-grep-shezhi-shuru" contenteditable="true">' + sjlx[i].cz + '</div>\
                    <span class="div-box-top-shezhi-tiaomu-div-sp">' + num[i] + '替换&nbsp;&nbsp;</span>\
                    <div id="daanth' + (i + 1) + '" class="div-box-grep-shezhi-shuru" contenteditable="true">' + sjlx[i].th + '</div>\
                </div>\
                <div class="daan-zhengzechuli-box">\
                    <span class="div-box-top-shezhi-tiaomu-div-sp">' + num[i] + '题型&nbsp;&nbsp;</span>\
                    <div id="daanxgq' + (i + 1) + '" class="div-box-grep-shezhi-zhanshi">' + sjlx[i].tx + '</div>\
                    <span class="div-box-top-shezhi-tiaomu-div-sp">' + num[i] + '格式&nbsp;&nbsp;</span>\
                    <div id="daanxgh' + (i + 1) + '" class="div-box-grep-shezhi-zhanshi">' + sjlx[i].gs + '</div>\
                </div>\
            ');
        } else {
            $("#daangeshiliebiao").append('\
                <div class="daan-zhengzechuli-box">\
                <span class="div-box-top-shezhi-tiaomu-div-sp">' + num[i] + '查找&nbsp;&nbsp;</span>\
                    <div id="daancz' + (i + 1) + '" class="div-box-grep-shezhi-shuru" contenteditable="true">' + sjlx[i].cz + '</div>\
                    <span class="div-box-top-shezhi-tiaomu-div-sp">' + num[i] + '替换&nbsp;&nbsp;</span>\
                    <div id="daanth' + (i + 1) + '" class="div-box-grep-shezhi-shuru" contenteditable="true">' + sjlx[i].th + '</div>\
                </div>\
            ');
        }
    }
}

//拼合下拉
function pinhexiala() {
    var pinhe = $("#pinhe").val();
    if (pinhe == "无") {
        $("#qianzhui").val("");
        $("#houzhui").val("");
    }
    pinheTijiaoPanding();
    pinhefuwei();
}

//拼合前缀后缀输入
function pinheshuru() {
    pinhepanding();
    pinheTijiaoPanding();
    pinhefuwei();

}

//拼合输入判定
function pinhepanding() {
    var qianzhui = $("#qianzhui").val();
    var houzhui = $("#houzhui").val();
    if (qianzhui == "" && houzhui == "") {
        $("#pinhe").val("无");
    } else {
        $("#pinhe").val("自定义");
    }
}

//拼合提交
function pinhetijiao() {
    if ($("#tijiaoanniu").attr("class") == "div-box-top-tijiao-anniu") {
        neiwengaoliangN();
        daangaoliangN();
        var leibie = $("#leibie").val();
        var chanpin1 = $("#chanpin1").val();
        var chanpin2 = $("#chanpin2").val();
        var tihuan = $("#tihuan").val();
        var neiwenC = $("#neiwenC").html();

        //内文格式获取
        var neiwencz1 = $("#neiwencz1").html();
        var neiwenth1 = $("#neiwenth1").html();
        neiwencz1 = HTMLDecode(neiwencz1);
        neiwenth1 = neiwenth1.replace(/\\n/g, "\n");
        var neiwencz2 = $("#neiwencz2").html();
        var neiwenth2 = $("#neiwenth2").html();
        neiwencz2 = HTMLDecode(neiwencz2);
        neiwenth2 = neiwenth2.replace(/\\n/g, "\n");
        var neiwencz3 = $("#neiwencz3").html();
        var neiwenth3 = $("#neiwenth3").html();
        neiwencz3 = HTMLDecode(neiwencz3);
        neiwenth3 = neiwenth3.replace(/\\n/g, "\n");
        var neiwencz4 = $("#neiwencz4").html();
        var neiwenth4 = $("#neiwenth4").html();
        neiwencz4 = HTMLDecode(neiwencz4);
        neiwenth4 = neiwenth4.replace(/\\n/g, "\n");
        var neiwencz5 = $("#neiwencz5").html();
        var neiwenth5 = $("#neiwenth5").html();
        neiwencz5 = HTMLDecode(neiwencz5);
        neiwenth5 = neiwenth5.replace(/\\n/g, "\n");
        var neiwencz6 = $("#neiwencz6").html();
        var neiwenth6 = $("#neiwenth6").html();
        neiwencz6 = HTMLDecode(neiwencz6);
        neiwenth6 = neiwenth6.replace(/\\n/g, "\n");
        var neiwencz7 = $("#neiwencz7").html();
        var neiwenth7 = $("#neiwenth7").html();
        neiwencz7 = HTMLDecode(neiwencz7);
        neiwenth7 = neiwenth7.replace(/\\n/g, "\n");
        var neiwencz8 = $("#neiwencz8").html();
        var neiwenth8 = $("#neiwenth8").html();
        neiwencz8 = HTMLDecode(neiwencz8);
        neiwenth8 = neiwenth8.replace(/\\n/g, "\n");
        var neiwencz9 = $("#neiwencz9").html();
        var neiwenth9 = $("#neiwenth9").html();
        neiwencz9 = HTMLDecode(neiwencz9);
        neiwenth9 = neiwenth9.replace(/\\n/g, "\n");
        var neiwencz10 = $("#neiwencz10").html();
        var neiwenth10 = $("#neiwenth10").html();
        neiwencz10 = HTMLDecode(neiwencz10);
        neiwenth10 = neiwenth10.replace(/\\n/g, "\n");

        //内文格式处理
        if (neiwencz1 != "") {
            neiwenC = neiwenC.replace(new RegExp(neiwencz1, 'g'), neiwenth1);
        }
        if (neiwencz2 != "") {
            neiwenC = neiwenC.replace(new RegExp(neiwencz2, 'g'), neiwenth2);
        }
        if (neiwencz3 != "") {
            neiwenC = neiwenC.replace(new RegExp(neiwencz3, 'g'), neiwenth3);
        }
        if (neiwencz4 != "") {
            neiwenC = neiwenC.replace(new RegExp(neiwencz4, 'g'), neiwenth4);
        }
        if (neiwencz5 != "") {
            neiwenC = neiwenC.replace(new RegExp(neiwencz5, 'g'), neiwenth5);
        }
        if (neiwencz6 != "") {
            neiwenC = neiwenC.replace(new RegExp(neiwencz6, 'g'), neiwenth6);
        }
        if (neiwencz7 != "") {
            neiwenC = neiwenC.replace(new RegExp(neiwencz7, 'g'), neiwenth7);
        }
        if (neiwencz8 != "") {
            neiwenC = neiwenC.replace(new RegExp(neiwencz8, 'g'), neiwenth8);
        }
        if (neiwencz9 != "") {
            neiwenC = neiwenC.replace(new RegExp(neiwencz9, 'g'), neiwenth9);
        }
        if (neiwencz10 != "") {
            neiwenC = neiwenC.replace(new RegExp(neiwencz10, 'g'), neiwenth10);
        }

        var neiwenCA = neiwenC.match(new RegExp(tihuan, 'g'));
        var tiqu = $("#tiqu").val();
        var daanC = $("#daanC").html();
        var daanCA = daanC.match(new RegExp(tiqu, 'g'));
        var daanCG = daanC.match(new RegExp(tiqu, 'g'));
        var qianzhui = $("#qianzhui").val();
        var houzhui = $("#houzhui").val();
        if (neiwenCA == null || daanCA == null) {
            $("#pinhebiaoti").html("拼合部分");
            $("#pinhebiaoti").css("color", colorMoshi4);
            swal("拼合异常", "“替换的内文” 或 “提取的答案” 找不到内容", "error");
        } else if (neiwenCA.length == daanCA.length && neiwenCA != null && daanCA != null) {
            //答案格式获取
            var daancz1 = $("#daancz1").html();
            var daanth1 = $("#daanth1").html();
            daancz1 = HTMLDecode(daancz1);
            daanth1 = daanth1.replace(/\\n/g, "\n");
            var daancz2 = $("#daancz2").html();
            var daanth2 = $("#daanth2").html();
            daancz2 = HTMLDecode(daancz2);
            daanth2 = daanth2.replace(/\\n/g, "\n");
            var daancz3 = $("#daancz3").html();
            var daanth3 = $("#daanth3").html();
            daancz3 = HTMLDecode(daancz3);
            daanth3 = daanth3.replace(/\\n/g, "\n");
            var daancz4 = $("#daancz4").html();
            var daanth4 = $("#daanth4").html();
            daancz4 = HTMLDecode(daancz4);
            daanth4 = daanth4.replace(/\\n/g, "\n");
            var daancz5 = $("#daancz5").html();
            var daanth5 = $("#daanth5").html();
            daancz5 = HTMLDecode(daancz5);
            daanth5 = daanth5.replace(/\\n/g, "\n");
            var daancz6 = $("#daancz6").html();
            var daanth6 = $("#daanth6").html();
            daancz6 = HTMLDecode(daancz6);
            daanth6 = daanth6.replace(/\\n/g, "\n");
            var daancz7 = $("#daancz7").html();
            var daanth7 = $("#daanth7").html();
            daancz7 = HTMLDecode(daancz7);
            daanth7 = daanth7.replace(/\\n/g, "\n");
            var daancz8 = $("#daancz8").html();
            var daanth8 = $("#daanth8").html();
            daancz8 = HTMLDecode(daancz8);
            daanth8 = daanth8.replace(/\\n/g, "\n");
            var daancz9 = $("#daancz9").html();
            var daanth9 = $("#daanth9").html();
            daancz9 = HTMLDecode(daancz9);
            daanth9 = daanth9.replace(/\\n/g, "\n");
            var daancz10 = $("#daancz10").html();
            var daanth10 = $("#daanth10").html();
            daancz10 = HTMLDecode(daancz10);
            daanth10 = daanth10.replace(/\\n/g, "\n");

            for (i = 0; i < neiwenCA.length; i++) {
                //答案格式处理
                if (daancz1 != "") {
                    daanCA[i] = daanCA[i].replace(new RegExp(daancz1, 'g'), daanth1);
                }
                if (daancz2 != "") {
                    daanCA[i] = daanCA[i].replace(new RegExp(daancz2, 'g'), daanth2);
                }
                if (daancz3 != "") {
                    daanCA[i] = daanCA[i].replace(new RegExp(daancz3, 'g'), daanth3);
                }
                if (daancz4 != "") {
                    daanCA[i] = daanCA[i].replace(new RegExp(daancz4, 'g'), daanth4);
                }
                if (daancz5 != "") {
                    daanCA[i] = daanCA[i].replace(new RegExp(daancz5, 'g'), daanth5);
                }
                if (daancz6 != "") {
                    daanCA[i] = daanCA[i].replace(new RegExp(daancz6, 'g'), daanth6);
                }
                if (daancz7 != "") {
                    daanCA[i] = daanCA[i].replace(new RegExp(daancz7, 'g'), daanth7);
                }
                if (daancz8 != "") {
                    daanCA[i] = daanCA[i].replace(new RegExp(daancz8, 'g'), daanth8);
                }
                if (daancz9 != "") {
                    daanCA[i] = daanCA[i].replace(new RegExp(daancz9, 'g'), daanth9);
                }
                if (daancz10 != "") {
                    daanCA[i] = daanCA[i].replace(new RegExp(daancz10, 'g'), daanth10);
                }
                neiwenC = neiwenC.replace(new RegExp(tihuan), ("<span class='pinheyanse' style='transition: all 0.1s; background:" + colorMoshi5 + ";color:" + colorMoshi3 + "'><span class='pinhexuhao' style='transition: all 0.1s;'>拼合" + (i + 1) + "→ </span>" + qianzhui + daanCA[i] + houzhui + "</span><div class='pinheduibi' style='color:" + colorMoshi6 + "'>" + daanCG[i] + "</div>"));
            }

            if (leibie == "英语" && chanpin1 == "试卷类" && chanpin2 != "金典卷") {
                var daanCTtlcl = daanC.match(/〖HT\d”*H〗附：〖HT\d”*H〗[\s\S]*?(?=(\n\n+)|$)/g);
                if (daanCTtlcl != null) {
                    for (i = 0; i < daanCTtlcl.length; i++) {
                        neiwenC = neiwenC.replace(/〖BP[（(]〗听力材料〖BP[）)]〗/, daanCTtlcl[i] + "〖HT〗");
                    }
                    neiwenC = neiwenC.replace(/〖HT\d”*H〗附：〖HT\d”*H〗/g, "〖HT4”H〗附：〖HT5”H〗");
                }
            } else if (leibie == "英语" && chanpin1 == "试卷类" && chanpin2 == "金典卷") {
                var daanCTtlcl = daanC.match(/〖JZ〗〖HTH〗听力部分录音材料〖HTSS〗[\s\S]*?(?=(\n\n+)|$)/g);
                if (daanCTtlcl != null) {
                    for (i = 0; i < daanCTtlcl.length; i++) {
                        neiwenC = neiwenC.replace(/〖BP[（(]〗听力材料〖BP[）)]〗/, daanCTtlcl[i] + "〖HT〗");
                    }
                    neiwenC = neiwenC.replace(/〖JZ〗〖HTH〗听力部分录音材料〖HTSS〗/g, "〖JZ〗〖HT5”H〗听力部分录音材料〖HTSS〗");
                }
            } else if (leibie == "英语" && chanpin1 == "报纸类") {
                var daanCTtlcl = daanC.match(/〖JZ〗〖HT4"H〗附：听力原文〖HT5"BS〗[\s\S]*?(?=(\n\n+)|$)/g);
                if (daanCTtlcl != null) {
                    for (i = 0; i < daanCTtlcl.length; i++) {
                        neiwenC = neiwenC.replace(/〖BP[（(]〗听力材料〖BP[）)]〗/, daanCTtlcl[i] + "\n");
                    }
                }
            }

            //粘贴剪切板
            neiwenCJ = neiwenC.replace(/<div class='pinheduibi' style='color:orange'>[\s\S]+?<\/div>/g, "");
            neiwenCJ = neiwenCJ.replace(/(<[ds/].+?[nv]*>)|(拼合\d+→ )/g, "");
            neiwenCJ = neiwenCJ.replace(/&amp;/g, "&");
            neiwenCJ = neiwenCJ.replace(/&lt;/g, "<");
            neiwenCJ = neiwenCJ.replace(/&gt;/g, ">");
            neiwenCJ = neiwenCJ.replace(/&quot;/g, "\'");
            neiwenCJ = neiwenCJ.replace(/&apos;/g, "\"");
            neiwenCJ = neiwenCJ.replace(/<br>/g, "\n");
            $(".copyPinhe-box").show();
            $(".copyPinhe").val(neiwenCJ);
            $(".copyPinhe").select();
            document.execCommand("copy");
            $(".copyPinhe-box").hide();

            neiwenC = neiwenC.replace(/\n/g, "<br>");
            $("#pinheC").html(neiwenC);
            $("#pinhezifu").html(neiwenCJ.length);
            $("#pinhebiaoti").html("拼合部分 " + neiwenCA.length);
            $("#pinhebiaoti").css("color", colorMoshi1);
            $(".pinheduibi").hide();
            pinhegaoliangN();
            pinhejianchaN();
            swal(chanpin1 + "\n" + leibie + " 拼合成功", "“拼合内容” 已复制到剪切板，粘贴即可使用", "success");
        } else {
            $("#pinhebiaoti").html("拼合部分");
            $("#pinhebiaoti").css("color", colorMoshi4);
            swal("拼合异常", "“替换的内文” 与 “提取的答案” 数量不匹配", "error");
        }
    }
}

//拼合判定
function pinheTijiaoPanding() {
    var neiwenC = $("#neiwenC").html();
    var daanC = $("#daanC").html();
    var tihuan = $("#tihuan").val();
    var tiqu = $("#tiqu").val();
    $("#pinhezifu").html(0);
    if ($("#tihuanqueding").attr("class") == "div-box-top-xianshi-queding-jinzhi" && $("#tiququeding").attr("class") == "div-box-top-xianshi-queding-jinzhi" && neiwenC != "" && daanC != "" && tihuan != "" && tiqu != "") {
        $("#tijiaoanniu").removeClass("div-box-top-tijiao-anniu-jinzhi").addClass("div-box-top-tijiao-anniu");
    } else {
        $("#tijiaoanniu").removeClass("div-box-top-tijiao-anniu").addClass("div-box-top-tijiao-anniu-jinzhi");
        pinhegaoliangN();
        pinhejianchaN();
    }
}

//内文输入字符统计
function neiwenZifuTongji() {
    var neiwenC = $("#neiwenC").html();
    $("#neiwenzifu").html(neiwenC.length);
}

//内文输入
function neiwenshuru() {
    $("#neiwenwenjianming-box").html("");
    var neiwenC = $("#neiwenC").html();
    var tihuan = $("#tihuan").val();
    neiwenZifuTongji();
    if (neiwenC != "") {
        $("#neiwenbiaoti").css("color", colorMoshi1);
        if ($("#tihuanqueding").attr("class") == "div-box-top-xianshi-queding-jinzhi" && neiwenC != "" && tihuan != "") {
            $("#tihuanqueding").removeClass("div-box-top-xianshi-queding-jinzhi").addClass("div-box-top-xianshi-queding");
        }
        $("#neiwenbiaoti").html("内文部分");
    } else {
        $("#neiwenbiaoti").css("color", colorMoshi4);
        tihuanquedingY();
    }
    $("#neiwenbiaoti").html("内文部分");
    pinheTijiaoPanding();
    pinhefuwei();
}

//内文高亮
function neiwengaoliang() {
    var neiwenC = $("#neiwenC").html();
    var tihuan = $("#tihuan").val();
    if ($("#neiwengaoliang").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng" && tihuan != "" && neiwenC != "") {
        tihuanquedingY();
        neiwengaoliangY();
    } else if ($("#neiwengaoliang").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng-xuanze") {
        neiwengaoliangN();
    }
    pinheTijiaoPanding();
}

//内文高亮开启
function neiwengaoliangY() {
    $("#neiwengaoliang").removeClass("div-box-center-mokuai-bufen-shuru-gongneng").addClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze");
    var tihuan = $("#tihuan").val();
    var neiwenC = $("#neiwenC").html();
    if (neiwenC != "") {
        if (tihuan != "") {
            var neiwenCount = neiwenC.match(new RegExp(tihuan, 'g'));
        } else {
            var neiwenCount = null;
        }
    }
    tihuan = "(" + tihuan + ")";
    thbj = "替换标记"
    neiwenC = neiwenC.replace(new RegExp(tihuan, 'g'), ("<span style='transition: all 0.1s; background:" + colorMoshi5 + ";color:" + colorMoshi3 + "'>" + thbj + "$1</span>"));
    var neiwenXuhao = "(<span.+?>)" + thbj + "([\\s\\S]+?)(</span>)";
    if (neiwenCount != null) {
        for (i = 0; i < neiwenCount.length; i++) {
            neiwenC = neiwenC.replace(new RegExp(neiwenXuhao), ("$1替换" + (i + 1) + "→ $2$3"));
        }
    }
    neiwenC = neiwenC.replace(/\n/g, "<br>")
    $("#neiwenC").html(neiwenC);
    $("#neiwenC").css("-webkit-user-modify", "read-only");
    $("#neiwenC").css("user-select", "none");
}

//内文高亮关闭
function neiwengaoliangN() {
    $("#neiwengaoliang").removeClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze").addClass("div-box-center-mokuai-bufen-shuru-gongneng");
    var neiwenC = $("#neiwenC").html();
    neiwenC = neiwenC.replace(/<span style.+?替换\d+→ /g, "");
    neiwenC = neiwenC.replace(/<\/span>/g, "");
    neiwenC = neiwenC.replace(/<br>/g, "\n")
    $("#neiwenC").html(neiwenC);
    $("#neiwenC").css("-webkit-user-modify", "read-write-plaintext-only");
    $("#neiwenC").css("user-select", "auto");
}

//内文放大
function neiwenfangda() {
    if ($("#neiwenfangda").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng") {
        neiwenfangdaY();
    } else if ($("#neiwenfangda").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng-xuanze") {
        neiwenfangdaN();
    }
}

//内文放大开启
function neiwenfangdaY() {
    $("#neiwenfangda").removeClass("div-box-center-mokuai-bufen-shuru-gongneng").addClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze");
    $("#daanmokuai").hide();
    $("#pinhemokuai").hide();
    $("#neiwenfangda").html("缩小");
    $(".div-box-center-mokuai-bufen-shuru").css("width", "1224px");
}

//内文放大关闭
function neiwenfangdaN() {
    $("#neiwenfangda").removeClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze").addClass("div-box-center-mokuai-bufen-shuru-gongneng");
    $("#daanmokuai").show();
    $("#pinhemokuai").show();
    $("#neiwenfangda").html("放大");
    $(".div-box-center-mokuai-bufen-shuru").css("width", "380px");
}

//内文书版
function neiwenshuban() {
    var file = $("#neiwenwenjian").prop('files'); //获取到文件列表
    if (file.length > 0) { //判断读取文件是否存在
        var reader = new FileReader(); //新建一个FileReader
        reader.readAsText(file[0], "gb2312"); //读取文件 
        reader.onload = function (evt) { //读取完文件之后会回来这里
            var filetring = evt.target.result; // 读取文件内容
            filetring = HTMLEncode(filetring);
            $("#neiwenC").html(filetring); //赋值文件到内文框
            var neiwenC = $("#neiwenC").html();
            neiwenZifuTongji();
            if (neiwenC != "") {
                $("#neiwenbiaoti").css("color", colorMoshi1);
            } else {
                $("#neiwenbiaoti").css("color", colorMoshi4);
            };
            $("#neiwenwenjianming-box").html(""); //清空文件名
            $("#neiwenwenjianming-box").append("<span id='neiwenwenjianming'>" + file[0].name + "</span>"); //赋予新的读取文件的文件名到内文标题
            $("#neiwenwenjian").val(""); //清空文件对象
        }
        $("#neiwenbiaoti").css("color", colorMoshi1);
        if ($("#tihuanqueding").attr("class") == "div-box-top-xianshi-queding-jinzhi" && neiwenC != "" && tihuan != "") {
            $("#tihuanqueding").removeClass("div-box-top-xianshi-queding-jinzhi").addClass("div-box-top-xianshi-queding");
        }
        $("#neiwenbiaoti").html("内文部分");
        $("#pinheC").html("");
        $("#pinhezifu").html(0);
        $("#pinhebiaoti").html("拼合部分");
        $("#pinhebiaoti").css("color", colorMoshi4);
    }

}


//答案输入字符统计
function daanZifuTongji() {
    var daanC = $("#daanC").html();
    $("#daanzifu").html(daanC.length);
}

//答案输入
function daanshuru() {
    $("#daanwenjianming-box").html("");
    var daanC = $("#daanC").html();
    var tiqu = $("#tiqu").val();
    daanZifuTongji();
    if (daanC != "") {
        $("#daanbiaoti").css("color", colorMoshi1);
        if ($("#tiququeding").attr("class") == "div-box-top-xianshi-queding-jinzhi" && daanC != "" && tiqu != "") {
            $("#tiququeding").removeClass("div-box-top-xianshi-queding-jinzhi").addClass("div-box-top-xianshi-queding");
        }
        $("#daanbiaoti").html("答案部分");
    } else {
        $("#daanbiaoti").css("color", colorMoshi4);
        tiququedingY();
    }
    $("#daanbiaoti").html("答案部分");
    pinheTijiaoPanding();
    pinhefuwei();
}

//答案高亮
function daangaoliang() {
    var daanC = $("#daanC").html();
    var tiqu = $("#tiqu").val();
    if ($("#daangaoliang").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng" && daanC != "" && tiqu != "") {
        tiququedingY();
        daangaoliangY();
    } else if ($("#daangaoliang").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng-xuanze") {
        daangaoliangN();
    }
    pinheTijiaoPanding();
}

//答案高亮开启
function daangaoliangY() {
    $("#daangaoliang").removeClass("div-box-center-mokuai-bufen-shuru-gongneng").addClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze");
    var tiqu = $("#tiqu").val();
    var daanC = $("#daanC").html();
    if (daanC != "") {
        if (tiqu != "") {
            var daanCount = daanC.match(new RegExp(tiqu, 'g'));
        } else {
            var daanCount = null;
        }
    }
    tiqu = "(" + tiqu + ")";
    tqbj = "提取标记";
    daanC = daanC.replace(new RegExp(tiqu, 'g'), ("<span style='transition: all 0.1s; background:" + colorMoshi5 + ";color:" + colorMoshi3 + "'>" + tqbj + "$1</span>"));
    var daanXuhao = "(<span.+?>)" + tqbj + "([\\s\\S]+?)(</span>)";
    if (daanCount != null) {
        for (i = 0; i < daanCount.length; i++) {
            daanC = daanC.replace(new RegExp(daanXuhao), ("$1提取" + (i + 1) + "→ $2$3"));
        }
    }
    daanC = daanC.replace(/\n/g, "<br>");
    $("#daanC").html(daanC);
    $("#daanC").css("-webkit-user-modify", "read-only");
    $("#daanC").css("user-select", "none");
}

//答案高亮关闭
function daangaoliangN() {
    $("#daangaoliang").removeClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze").addClass("div-box-center-mokuai-bufen-shuru-gongneng");
    var daanC = $("#daanC").html();
    daanC = daanC.replace(/<span style.+?提取\d+→ /g, "");
    daanC = daanC.replace(/<\/span>/g, "");
    daanC = daanC.replace(/<br>/g, "\n")
    $("#daanC").html(daanC);
    $("#daanC").css("-webkit-user-modify", "read-write-plaintext-only");
    $("#daanC").css("user-select", "auto");
}

//答案放大
function daanfangda() {
    if ($("#daanfangda").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng") {
        daanfangdaY();
    } else if ($("#daanfangda").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng-xuanze") {
        daanfangdaN();
    }
}

//答案放大开启
function daanfangdaY() {
    $("#daanfangda").removeClass("div-box-center-mokuai-bufen-shuru-gongneng").addClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze");
    $("#neiwenmokuai").hide();
    $("#pinhemokuai").hide();
    $("#daanfangda").html("缩小");
    $(".div-box-center-mokuai-bufen-shuru").css("width", "1224px");
}

//答案放大关闭
function daanfangdaN() {
    $("#daanfangda").removeClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze").addClass("div-box-center-mokuai-bufen-shuru-gongneng");
    $("#neiwenmokuai").show();
    $("#pinhemokuai").show();
    $("#daanfangda").html("放大");
    $(".div-box-center-mokuai-bufen-shuru").css("width", "380px");
}

//答案书版
function daanshuban() {
    var file = $("#daanwenjian").prop('files'); //获取到文件列表
    if (file.length > 0) { //判断读取文件是否存在
        var reader = new FileReader(); //新建一个FileReader
        reader.readAsText(file[0], "gb2312"); //读取文件 
        reader.onload = function (evt) { //读取完文件之后会回来这里
            var filetring = evt.target.result; // 读取文件内容
            $("#daanC").html(filetring); //赋值文件到答案框
            var daanC = $("#daanC").html();
            daanZifuTongji();
            if (daanC != "") {
                $("#daanbiaoti").css("color", colorMoshi1);
            } else {
                $("#daanbiaoti").css("color", colorMoshi4);
            }
            $("#daanwenjianming-box").html(""); //清空文件名
            $("#daanwenjianming-box").append("<span id='daanwenjianming'>" + file[0].name + "</span>"); //赋予新的读取文件的文件名到内文标题
            $("#daanwenjian").val(""); //清空文件对象
        }
        $("#daanbiaoti").css("color", colorMoshi1);
        if ($("#tiququeding").attr("class") == "div-box-top-xianshi-queding-jinzhi" && daanC != "" && tiqu != "") {
            $("#tiququeding").removeClass("div-box-top-xianshi-queding-jinzhi").addClass("div-box-top-xianshi-queding");
        }
        $("#daanbiaoti").html("答案部分");
        $("#pinheC").html("");
        $("#pinhezifu").html(0);
        $("#pinhebiaoti").html("拼合部分");
        $("#pinhebiaoti").css("color", colorMoshi4);
    }
}

//拼合高亮
function pinhegaoliang() {
    var pinheC = $("#pinheC").html();
    // var pinheGundongtiaoWeizhiC = $('#pinheC').scrollTop();
    // console.log(pinheGundongtiaoWeizhiC);
    var pinheGundongtiaogaoduC = $('#pinheC').height();
    console.log(pinheGundongtiaogaoduC);
    if ($("#pinhegaoliang").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng" && pinheC != "") {
        pinhegaoliangY();
    } else if ($("#pinhegaoliang").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng-xuanze") {
        pinhegaoliangN();
    }
    // var pinheGundongtiaogaoduG = $('#pinheC').height();
    // $('#pinheC').scrollTop((pinheGundongtiaoWeizhiC * pinheGundongtiaogaoduG) / pinheGundongtiaogaoduC);
}

//拼合高亮开启
function pinhegaoliangY() {
    $("#pinhegaoliang").removeClass("div-box-center-mokuai-bufen-shuru-gongneng").addClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze");
    $(".pinheyanse").css("background-color", colorMoshi5);
    $(".pinhexuhao").show();
}

//拼合高亮关闭
function pinhegaoliangN() {
    $("#pinhegaoliang").removeClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze").addClass("div-box-center-mokuai-bufen-shuru-gongneng");
    $(".pinheyanse").css("background-color", colorMoshi2);
    $(".pinhexuhao").hide();
}

//拼合检查
function pinhejiancha() {
    var pinheC = $("#pinheC").html();
    // var pinheGundongtiaoWeizhiC = $('#pinheC').scrollTop();
    // console.log(pinheGundongtiaoWeizhiC);
    var pinheGundongtiaogaoduC = $('#pinheC').height();
    // console.log(pinheGundongtiaogaoduC);
    var pinheC = $("#pinheC").html();
    if ($("#pinhejiancha").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng" && pinheC != "") {
        pinhejianchaY();
    } else if ($("#pinhejiancha").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng-xuanze") {
        pinhejianchaN();
    }
    // var pinheGundongtiaogaoduG = $('#pinheC').height();
    // $('#pinheC').scrollTop((pinheGundongtiaoWeizhiC * pinheGundongtiaogaoduG) / pinheGundongtiaogaoduC);
}

//拼合检查开启
function pinhejianchaY() {
    $("#pinhejiancha").removeClass("div-box-center-mokuai-bufen-shuru-gongneng").addClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze");
    $(".pinheduibi").show();
    $(".pinheduibi").css("background-color", "colorMoshi7");
    $(".neiwengeshiduibi").show();
}

//拼合检查关闭
function pinhejianchaN() {
    $("#pinhejiancha").removeClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze").addClass("div-box-center-mokuai-bufen-shuru-gongneng");
    $(".pinheduibi").hide();
    $(".pinheduibi").css("background-color", "colorMoshi2");
    $(".neiwengeshiduibi").hide();
}

//拼合放大
function pinhefangda() {
    if ($("#pinhefangda").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng") {
        pinhefangdaY();
    } else if ($("#pinhefangda").attr("class") == "div-box-center-mokuai-bufen-shuru-gongneng-xuanze") {
        pinhefangdaN();
    }
}

//拼合放大开启
function pinhefangdaY() {
    $("#pinhefangda").removeClass("div-box-center-mokuai-bufen-shuru-gongneng").addClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze");
    $("#neiwenmokuai").hide();
    $("#daanmokuai").hide();
    $("#pinhefangda").html("缩小");
    $(".div-box-center-mokuai-bufen-shuru").css("width", "1224px");
}

//拼合放大关闭
function pinhefangdaN() {
    $("#pinhefangda").removeClass("div-box-center-mokuai-bufen-shuru-gongneng-xuanze").addClass("div-box-center-mokuai-bufen-shuru-gongneng");
    $("#neiwenmokuai").show();
    $("#daanmokuai").show();
    $("#pinhefangda").html("放大");
    $(".div-box-center-mokuai-bufen-shuru").css("width", "380px");
}

//拼合复位
function pinhefuwei() {
    pinhegaoliangN();
    pinhejianchaN();
    $("#pinheC").html("");
    $("#pinhezifu").html(0);
    $("#pinhebiaoti").html("拼合部分");
    $("#pinhebiaoti").css("color", colorMoshi4);
}

//HTML转义字符
function HTMLEncode(html) {
    var temp = document.createElement("div");
    (temp.textContent != null) ? (temp.textContent = html) : (temp.innerText = html);
    var output = temp.innerHTML;
    temp = null;
    return output;
}

//HTML反转义字符
function HTMLDecode(text) {
    var temp = document.createElement("div");
    temp.innerHTML = text;
    var output = temp.innerText || temp.textContent;
    temp = null;
    return output;
}